// 云函数入口文件
const cloud = require('wx-server-sdk')

cloud.init({
    env: cloud.DYNAMIC_CURRENT_ENV
})
// 云函数入口函数
exports.main = async (event, context) => {
    try {
        const result=await cloud.openapi.subscribeMessage.send({
            touser: event.openid,
            page:"pages/index/index",
            data:{
                thing1:{
                    value: event.title
                },
                thing12:{
                    value:"我是备注"
                }
        
            },
            templateId: "systUF3dKcJFL_KQtdscpIXno5HUpHr3-LtT5-0rd70"
        })
        console.log(result)
        return result;
    } catch (error) {
        console.log(error)
        return error
    }
}